Skip to content

feat(server): bound database connection pool#236

Merged
abhinav-galileo merged 7 commits into
mainfrom
abhi/agent-control-db-pooling
Jun 17, 2026
Merged

feat(server): bound database connection pool#236
abhinav-galileo merged 7 commits into
mainfrom
abhi/agent-control-db-pooling

Conversation

@abhinav-galileo

@abhinav-galileo abhinav-galileo commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add explicit async SQLAlchemy pool settings for non-SQLite databases.
  • Bound pool size, overflow, checkout timeout, connect timeout, and statement timeout.
  • Track checked-out SQLAlchemy connections with a Prometheus gauge.
  • Release evaluation DB sessions before evaluator execution and dispose the engine on shutdown.

Defaults

  • AGENT_CONTROL_DB_POOL_SIZE=5
  • AGENT_CONTROL_DB_MAX_OVERFLOW=10
  • AGENT_CONTROL_DB_POOL_TIMEOUT_SECONDS=5.0
  • AGENT_CONTROL_DB_CONNECT_TIMEOUT_SECONDS=5
  • AGENT_CONTROL_DB_STATEMENT_TIMEOUT_SECONDS=50.0

Validation

  • uv run --package agent-control-server ruff check --config pyproject.toml server/src server/tests/test_config.py server/tests/test_db.py server/tests/test_evaluation_error_handling.py
  • uv run --package agent-control-server mypy --config-file pyproject.toml server/src
  • GitHub CI passing

@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@abhinav-galileo abhinav-galileo force-pushed the abhi/agent-control-db-pooling branch from 54d842f to ed28d63 Compare June 8, 2026 12:49
@abhinav-galileo abhinav-galileo marked this pull request as ready for review June 8, 2026 12:50
@abhinav-galileo abhinav-galileo marked this pull request as draft June 8, 2026 12:50
@abhinav-galileo abhinav-galileo marked this pull request as ready for review June 8, 2026 12:53
@abhinav-galileo abhinav-galileo changed the title Bound Agent Control database connection pool fix(server): bound database connection pool Jun 11, 2026
- bound connection establishment and per-statement runtime at the
  driver level for non-SQLite URLs (psycopg and asyncpg)
- default AGENT_CONTROL_DB_MAX_OVERFLOW to 10 so short bursts borrow
  transient connections instead of failing after the pool timeout
- initialize the checked-out-connections gauge so idle processes
  report 0 instead of an absent series
@abhinav-galileo abhinav-galileo changed the title fix(server): bound database connection pool feat(server): bound database connection pool Jun 11, 2026
@abhinav-galileo abhinav-galileo marked this pull request as draft June 12, 2026 18:41
@abhinav-galileo abhinav-galileo marked this pull request as ready for review June 15, 2026 15:35
Comment thread server/src/agent_control_server/db.py
Comment thread server/src/agent_control_server/db.py Outdated
@abhinav-galileo abhinav-galileo merged commit 80aea8f into main Jun 17, 2026
6 checks passed
@abhinav-galileo abhinav-galileo deleted the abhi/agent-control-db-pooling branch June 17, 2026 12:06
galileo-automation pushed a commit that referenced this pull request Jun 17, 2026
## [3.1.0](ts-sdk-v3.0.0...ts-sdk-v3.1.0) (2026-06-17)

### Features

* **engine:** add evaluation runtime tuning ([#239](#239)) ([2f1e5fe](2f1e5fe))
* **server:** bound database connection pool ([#236](#236)) ([80aea8f](80aea8f))

### Bug Fixes

* **evaluators:** configure Luna scorer API URL ([#237](#237)) ([fc516f0](fc516f0))
* **server:** use plain psycopg with OS libpq ([#241](#241)) ([45a33a5](45a33a5))
@galileo-automation

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants